<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>车辆管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/travel/bus/">车辆列表</a></li>
		<shiro:hasPermission name="travel:bus:edit"><li><a href="${ctx}/travel/bus/form">车辆添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="bus" action="${ctx}/travel/bus/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>车牌号 ：</label><form:input path="number" htmlEscape="false" maxlength="50" class="input-medium"/>
		<label>司机姓名 ：</label><form:input path="drivers" htmlEscape="false" maxlength="50" class="input-medium"/>
		<label>主要途经地：</label><form:input path="roadLine" htmlEscape="false" maxlength="50" class="input-medium"/>
		
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead>
			<tr>
				<th>车牌号</th>
				<th>二维码编号</th>
				<th>司机姓名</th>
				<th>起始地</th>
				<th>终到地</th>
				<th>主要途经地</th>
				<shiro:hasPermission name="travel:bus:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bus">
			<tr>
				<td>${bus.number} </td>
				<td>${bus.qrcodeNumber} </td>
				<td>${bus.drivers} </td>
				<td>${bus.startPlace} </td>
				<td>${bus.endPlace} </td>
				<td>${bus.roadLine} </td>
				<shiro:hasPermission name="travel:bus:edit">
				<td>
    				
    				<tags:qrcode id="qrcode${bus.qrCode.id }" name="qrCode${bus.qrCode.id }" value="${bus.qrCode.id }"  title="二维码"  cssClass="input-small"/>
    				<button id="Button${bus.id }" class="butprint btn btn-info " style="display:none">打印</button>
    				<a href="${ctx}/travel/bus/form?id=${bus.id}"  class="btn btn-info">修改</a>
					<shiro:hasPermission name="sys:user:edit">
					<a href="${ctx}/travel/bus/delete?id=${bus.id}" onclick="return confirmx('确认要删除该车辆吗？', this.href)" class="btn btn-danger"  >删除</a>
					</shiro:hasPermission>
				</td>
				</shiro:hasPermission>
			</tr>
			
			<script type="text/javascript">
				$("#Button${bus.id}").click(function(){
					//alert("${ctx}/momarketing/qrCode/beautify/${value}.html");
					top.$.jBox.open("iframe:${ctx}/travel/bus/view/${bus.id}.html", "打印预览", 1000, 500, {
						buttons:{ "打印":'print', "关闭":true}, submit:function(v, h, f){
							if (v=="print"){
								h.find("iframe")[0].contentWindow.printArea();
								return false;
							}
						}, loaded:function(h){
							$(".jbox-content", top.document).css("overflow-y","hidden");
						}
					});
				});
	
			</script>
			
			
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>

</html>
